<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#222" media="(prefers-color-scheme: dark)"><meta name="generator" content="Hexo 7.3.0">
<link rel="preconnect" href="https://cdn.staticfile.net" crossorigin>
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-round.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-round.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-round.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.staticfile.net/font-awesome/6.6.0/css/all.min.css" integrity="sha256-5eIC48iZUHmSlSUz9XtjRyK2mzQkHScZY1WdMaoz74E=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"wangjiezhe.gitee.io","root":"/","images":"/images","scheme":"Gemini","darkmode":true,"version":"8.21.1","exturl":true,"sidebar":{"position":"left","width_expanded":320,"width_dual_column":240,"display":"post","padding":18,"offset":12},"hljswrap":true,"copycode":{"enable":true,"style":"mac"},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":true,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":"disqusjs","storage":true,"lazyload":true,"nav":{"disqusjs":{"text":"Disqus","order":1},"giscus":{"text":"GitHub","order":2},"discussbot":{"text":"Telegram","order":3}},"activeClass":"disqusjs"},"stickytabs":false,"motion":{"enable":false,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"top_n_per_article":1,"unescape":false,"preload":false,"style":"flat"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="在我的 Vultr 上安装 Nextcloud">
<meta property="og:type" content="article">
<meta property="og:title" content="在 ArchLinux 上安装 Nextcloud">
<meta property="og:url" content="https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/index.html">
<meta property="og:site_name" content="如鱼饮水">
<meta property="og:description" content="在我的 Vultr 上安装 Nextcloud">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-04-09T01:29:08.000Z">
<meta property="article:modified_time" content="2021-04-09T01:29:08.000Z">
<meta property="article:author" content="西风冷香">
<meta property="article:tag" content="ArchLinux">
<meta property="article:tag" content="Nextcloud">
<meta property="article:tag" content="Nginx">
<meta property="article:tag" content="Vultr">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/">


<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/","path":"/posts/2021-04-09-Install-Nextcloud-on-vultr/","title":"在 ArchLinux 上安装 Nextcloud"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>在 ArchLinux 上安装 Nextcloud | 如鱼饮水</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-48537410-1"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-48537410-1","only_pageview":false,"measure_protocol_api_secret":null}</script>
  <script src="/js/third-party/analytics/google-analytics.js"></script>

  <script src="/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?a51d31f349bffa6e3757f7d6fca0c47f"></script>


  <script data-pjax defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{&quot;token&quot;: &quot;a64c9e77fe904641b6e6b04b0e80969c&quot;}'></script>





  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="如鱼饮水" type="application/atom+xml">
<link rel="alternate" href="/rss2.xml" title="如鱼饮水" type="application/rss+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">如鱼饮水</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">冷暖自知</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-links"><a href="/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a></li><li class="menu-item menu-item-fcircle"><a href="/fcircle/" rel="section"><i class="fa fa-user-group fa-fw"></i>朋友圈</a></li><li class="menu-item menu-item-tools"><a href="/tools/" rel="section"><i class="fa fa-rocket fa-fw"></i>工具</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
      <div class="search-header">
        <span class="search-icon">
          <i class="fa fa-search"></i>
        </span>
        <div class="search-input-container">
          <input autocomplete="off" autocapitalize="off" maxlength="80"
                placeholder="搜索..." spellcheck="false"
                type="search" class="search-input">
        </div>
        <span class="popup-btn-close" role="button">
          <i class="fa fa-times-circle"></i>
        </span>
      </div>
      <div class="search-result-container">
        <div class="search-result-icon">
          <i class="fa fa-spinner fa-pulse fa-5x"></i>
        </div>
      </div>
    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E9%85%8D%E7%BD%AE%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="nav-text">1. 配置数据库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E9%85%8D%E7%BD%AE-php"><span class="nav-text">2. 配置 php</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E9%85%8D%E7%BD%AE-Redis-%E7%BC%93%E5%AD%98"><span class="nav-text">3. 配置 Redis 缓存</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E9%85%8D%E7%BD%AE-php-fpm"><span class="nav-text">4. 配置 php-fpm</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E9%85%8D%E7%BD%AE%E5%9F%9F%E5%90%8D"><span class="nav-text">5. 配置域名</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-%E9%85%8D%E7%BD%AE-nginx"><span class="nav-text">6. 配置 nginx</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-%E9%85%8D%E7%BD%AE-nextcloud"><span class="nav-text">7. 配置 nextcloud</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-%E9%85%8D%E7%BD%AE-pacman-hook"><span class="nav-text">8. 配置 pacman hook</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="西风冷香"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">西风冷香</p>
  <div class="site-description" itemprop="description">某不知名机构不知名数学老师</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">67</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">103</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3dhbmdqaWV6aGU=" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;wangjiezhe"><i class="fab fa-github fa-fw"></i></span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOndhbmdqaWV6aGVAZ21haWwuY29t" title="E-Mail → mailto:wangjiezhe@gmail.com"><i class="fa fa-envelope fa-fw"></i></span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly90d2l0dGVyLmNvbS93YW5namllemhl" title="Twitter → https:&#x2F;&#x2F;twitter.com&#x2F;wangjiezhe"><i class="fab fa-twitter fa-fw"></i></span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly90Lm1lL3dhbmdqaWV6aGU=" title="Telegram → https:&#x2F;&#x2F;t.me&#x2F;wangjiezhe"><i class="fab fa-telegram fa-fw"></i></span>
      </span>
  </div>
<div id="time-now">
  <canvas id="canvas" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
</div>
<script>
(function(){

  var digit=
    [
      [
        [0,0,1,1,1,0,0],
        [0,1,1,0,1,1,0],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,0,1,1,0],
        [0,0,1,1,1,0,0]
      ],//0
      [
        [0,0,0,1,1,0,0],
        [0,1,1,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [1,1,1,1,1,1,1]
      ],//1
      [
        [0,1,1,1,1,1,0],
        [1,1,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,0,0],
        [0,0,1,1,0,0,0],
        [0,1,1,0,0,0,0],
        [1,1,0,0,0,0,0],
        [1,1,0,0,0,1,1],
        [1,1,1,1,1,1,1]
      ],//2
      [
        [1,1,1,1,1,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,0,0,1,1,0],
        [0,0,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,1,1,0]
      ],//3
      [
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,1,0],
        [0,0,1,1,1,1,0],
        [0,1,1,0,1,1,0],
        [1,1,0,0,1,1,0],
        [1,1,1,1,1,1,1],
        [0,0,0,0,1,1,0],
        [0,0,0,0,1,1,0],
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,1,1]
      ],//4
      [
        [1,1,1,1,1,1,1],
        [1,1,0,0,0,0,0],
        [1,1,0,0,0,0,0],
        [1,1,1,1,1,1,0],
        [0,0,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,1,1,0]
      ],//5
      [
        [0,0,0,0,1,1,0],
        [0,0,1,1,0,0,0],
        [0,1,1,0,0,0,0],
        [1,1,0,0,0,0,0],
        [1,1,0,1,1,1,0],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,1,1,0]
      ],//6
      [
        [1,1,1,1,1,1,1],
        [1,1,0,0,0,1,1],
        [0,0,0,0,1,1,0],
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,1,1,0,0,0],
        [0,0,1,1,0,0,0],
        [0,0,1,1,0,0,0],
        [0,0,1,1,0,0,0]
      ],//7
      [
        [0,1,1,1,1,1,0],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,1,1,0],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,1,1,0]
      ],//8
      [
        [0,1,1,1,1,1,0],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [1,1,0,0,0,1,1],
        [0,1,1,1,0,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,0,1,1],
        [0,0,0,0,1,1,0],
        [0,0,0,1,1,0,0],
        [0,1,1,0,0,0,0]
      ],//9
      [
        [0,0,0,0,0,0,0],
        [0,0,1,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,0,0,0,0,0],
        [0,0,0,0,0,0,0],
        [0,0,1,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,0,0,0,0,0]
      ]//:
    ];

  var canvas = document.getElementById('canvas');

  if(canvas.getContext){
    var cxt = canvas.getContext('2d');
    //声明canvas的宽高
    var H = 100,W = 700;
    canvas.height = H;
    canvas.width = W;
    cxt.fillStyle = '#f00';
    cxt.fillRect(10,10,50,50);
  
    //存储时间数据
    var data = [];
    //存储运动的小球
    var balls = [];
    //设置粒子半径
    var R = canvas.height/20-1;
    (function(){
      var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
      //存储时间数字，由十位小时、个位小时、冒号、十位分钟、个位分钟、冒号、十位秒钟、个位秒钟这7个数字组成
      data.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
    })();
  
    /*生成点阵数字*/
    function renderDigit(index,num){
      for(var i = 0; i < digit[num].length; i++){
        for(var j = 0; j < digit[num][i].length; j++){
          if(digit[num][i][j] == 1){
            cxt.beginPath();
            cxt.arc(14*(R+2)*index + j*2*(R+1)+(R+1),i*2*(R+1)+(R+1),R,0,2*Math.PI);
            cxt.closePath();
            cxt.fill();
          }
        }
      }
    }
  
    /*更新时钟*/
    function updateDigitTime(){
      var changeNumArray = [];
      var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
      var NewData = [];
      NewData.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
      for(var i = data.length-1; i >=0 ; i--){
        //时间发生变化
        if(NewData[i] !== data[i]){
          //将变化的数字值和在data数组中的索引存储在changeNumArray数组中
          changeNumArray.push(i+'_'+(Number(data[i])+1)%10);
        }
      }
      //增加小球
      for(var i = 0; i< changeNumArray.length; i++){
        addBalls.apply(this,changeNumArray[i].split('_'));
      }
      data = NewData.concat();
    }
  
    /*更新小球状态*/
    function updateBalls(){
      for(var i = 0; i < balls.length; i++){
        balls[i].stepY += balls[i].disY;
        balls[i].x += balls[i].stepX;
        balls[i].y += balls[i].stepY;
        if(balls[i].x > W + R || balls[i].y > H + R){
          balls.splice(i,1);
          i--;
        }
      }
    }
  
    /*增加要运动的小球*/
    function addBalls(index,num){
      var numArray = [1,2,3];
      var colorArray =  ["#3BE","#09C","#A6C","#93C","#9C0","#690","#FB3","#F80","#F44","#C00"];
      for(var i = 0; i < digit[num].length; i++){
        for(var j = 0; j < digit[num][i].length; j++){
          if(digit[num][i][j] == 1){
            var ball = {
              x:14*(R+2)*index + j*2*(R+1)+(R+1),
              y:i*2*(R+1)+(R+1),
              stepX:Math.floor(Math.random() * 4 -2),
              stepY:-2*numArray[Math.floor(Math.random()*numArray.length)],
              color:colorArray[Math.floor(Math.random()*colorArray.length)],
              disY:1
            };
            balls.push(ball);
          }
        }
      }
    }
  
    /*渲染*/
    function render(){
      //重置画布宽度，达到清空画布的效果
      canvas.height = 100;
      //渲染时钟
      for(var i = 0; i < data.length; i++){
        renderDigit(i,data[i]);
      }
      //渲染小球
      for(var i = 0; i < balls.length; i++){
        cxt.beginPath();
        cxt.arc(balls[i].x,balls[i].y,R,0,2*Math.PI);
        cxt.fillStyle = balls[i].color;
        cxt.closePath();
        cxt.fill();
      }
    }
  
    clearInterval(oTimer);
    var oTimer = setInterval(function(){
      //更新时钟
      updateDigitTime();
      //更新小球状态
      updateBalls();
      //渲染
      render();
    },50);
  }

})();
</script>

<div id="site-days"></div>
<script>
  function show_date_time() {
    window.setTimeout("show_date_time()", 1000);
    BirthDay = new Date("2014/01/10 13:29:55");
    today = new Date();
    timeold = (today.getTime() - BirthDay.getTime());
    sectimeold = timeold / 1000;
    secondsold = Math.floor(sectimeold);
    msPerDay = 24 * 60 * 60 * 1000;
    e_daysold = timeold / msPerDay;
    daysold = Math.floor(e_daysold);
    e_hrsold = (e_daysold - daysold) * 24;
    hrsold = setzero(Math.floor(e_hrsold));
    e_minsold = (e_hrsold - hrsold) * 60;
    minsold = setzero(Math.floor((e_hrsold - hrsold) * 60));
    seconds = setzero(Math.floor((e_minsold - minsold) * 60));
    document.getElementById('site-days').innerHTML = "已运行" + daysold + "天" + hrsold + "小时" + minsold + "分" + seconds + "秒";
  }

  function setzero(i) {
    if (i < 10) {
      i = "0" + i
    }
    return i;
  }

  show_date_time();
</script>

        </div>
      </div>
    </div>

    
        <div class="pjax">
        </div>
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="西风冷香">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="如鱼饮水">
      <meta itemprop="description" content="某不知名机构不知名数学老师">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="在 ArchLinux 上安装 Nextcloud | 如鱼饮水">
      <meta itemprop="description" content="在我的 Vultr 上安装 Nextcloud">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          在 ArchLinux 上安装 Nextcloud
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-04-09 09:29:08" itemprop="dateCreated datePublished" datetime="2021-04-09T09:29:08+08:00">2021-04-09</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>9.3k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>23 分钟</span>
    </span>
</div>

            <div class="post-description">在我的 Vultr 上安装 Nextcloud</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>之前因为某些原因，弄了一台 Vultr 上的主机，有 1000GB 的带宽，基本上每月都用不完。因此就想着用来搭建一些服务自己来用。</p>
<p>之前尝试安装过 rsshub，不过后来转移到 Vercel 了。这次就想尝试安装一下 Nextcloud。</p>
<p>虽然我知道，直接用 docker 会更简单，不过既然 Nextcloud 以及在官方的源（我的系统是 Arch Linux）里了，就忍不住折腾一番。</p>
<p>需要用到的安装包：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pacman -S mariadb php nextcloud php-intl php-fpm redis php-redis</span><br></pre></td></tr></table></figure>
<p>由于之前已经安装并配置了 nginx，这个就不用重新在安装了。</p>
<h2 id="1-配置数据库"><a class="header-anchor" href="#1-配置数据库"></a>1. 配置数据库</h2>
<p>由于我用的文件系统是 btrfs，所以需要先禁用写时复制（CoW）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">btrfs subvolume create /var/lib/mysql</span><br><span class="line">chattr +C /var/lib/mysql</span><br></pre></td></tr></table></figure>
<p>然后运行数据库：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql</span><br><span class="line">systemctl <span class="built_in">enable</span> mariadb</span><br><span class="line">systemctl start mariadb</span><br></pre></td></tr></table></figure>
<p>增强安全性：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql_secure_installation</span><br></pre></td></tr></table></figure>
<p>限制只能本地访问：</p>
<figure class="highlight ini"><figcaption><span>/etc/my.cnf.d/server.cnf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[mysqld]</span></span><br><span class="line"><span class="attr">bind-address</span>=<span class="number">127.0</span>.<span class="number">0.1</span></span><br><span class="line">skip-networking</span><br></pre></td></tr></table></figure>
<p>自动补全功能：</p>
<figure class="highlight ini"><figcaption><span>/etc/my.cnf.d/mysql-clients.cnf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[mysql]</span></span><br><span class="line">auto-rehash</span><br></pre></td></tr></table></figure>
<p>配置 Nextcloud 的数据库：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">CREATE DATABASE nextcloud DEFAULT CHARACTER SET &#x27;utf8mb4&#x27; COLLATE &#x27;utf8mb4_general_ci&#x27;;</span><br><span class="line">GRANT ALL PRIVILEGES ON nextcloud.* TO &#x27;nextcloud&#x27;@&#x27;localhost&#x27; IDENTIFIED BY &#x27;&lt;password&gt;&#x27;;</span><br><span class="line">FLUSH PRIVILEGES;</span><br><span class="line">\q</span><br></pre></td></tr></table></figure>
<h2 id="2-配置-php"><a class="header-anchor" href="#2-配置-php"></a>2. 配置 php</h2>
<p>启用所需要的模块：</p>
<figure class="highlight ini"><figcaption><span>/etc/php/php.ini</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[php]</span></span><br><span class="line"><span class="attr">extension</span>=gd</span><br><span class="line"><span class="attr">extension</span>=iconv</span><br><span class="line"><span class="attr">extension</span>=intl</span><br><span class="line"><span class="attr">extension</span>=mysqli</span><br><span class="line"><span class="attr">zend_extension</span>=opcache</span><br><span class="line"><span class="attr">extension</span>=pdo_mysql</span><br><span class="line"></span><br><span class="line"><span class="attr">memory_limit</span> = <span class="number">512</span>M</span><br><span class="line"><span class="attr">upload_max_filesize</span> = <span class="number">1024</span>M</span><br></pre></td></tr></table></figure>
<h2 id="3-配置-Redis-缓存"><a class="header-anchor" href="#3-配置-Redis-缓存"></a>3. 配置 Redis 缓存</h2>
<p>启用 redis：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">systemctl <span class="built_in">enable</span> redis</span><br><span class="line">systemctl start redis</span><br></pre></td></tr></table></figure>
<p>配置 php 扩展：</p>
<figure class="highlight ini"><figcaption><span>/etc/php/conf.d/redis.ini</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">extension</span>=redis</span><br></pre></td></tr></table></figure>
<figure class="highlight ini"><figcaption><span>/etc/php/conf.d/igbinary.ini</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[igbinary]</span></span><br><span class="line"><span class="attr">extension</span>=igbinary.so</span><br></pre></td></tr></table></figure>
<p>在 nextcloud 的配置文件中启用 redis：</p>
<figure class="highlight php"><figcaption><span>/etc/webapps/nextcloud/config.php</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&#x27;memcache.distributed&#x27;</span> =&gt; <span class="string">&#x27;OCMemcacheRedis&#x27;</span>,</span><br><span class="line"><span class="string">&#x27;memcache.local&#x27;</span> =&gt; <span class="string">&#x27;OCMemcacheRedis&#x27;</span>,</span><br><span class="line"><span class="string">&#x27;memcache.locking&#x27;</span> =&gt; <span class="string">&#x27;OCMemcacheRedis&#x27;</span>,</span><br><span class="line"><span class="string">&#x27;redis&#x27;</span> =&gt; <span class="keyword">array</span>(</span><br><span class="line">     <span class="string">&#x27;host&#x27;</span> =&gt; <span class="string">&#x27;localhost&#x27;</span>,</span><br><span class="line">     <span class="string">&#x27;port&#x27;</span> =&gt; <span class="number">6379</span>,</span><br><span class="line">     ),</span><br></pre></td></tr></table></figure>
<h2 id="4-配置-php-fpm"><a class="header-anchor" href="#4-配置-php-fpm"></a>4. 配置 php-fpm</h2>
<p>在 php-fpm 添加 nextcloud 配置：</p>
<figure class="highlight ini"><figcaption><span>/etc/php/php-fpm.d/nextcloud.conf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[nextcloud]</span></span><br><span class="line"><span class="attr">user</span> = nextcloud</span><br><span class="line"><span class="attr">group</span> = nextcloud</span><br><span class="line"><span class="attr">listen</span> = /run/nextcloud/nextcloud.sock</span><br><span class="line">env<span class="section">[PATH]</span> = /usr/local/bin:/usr/bin:/bin</span><br><span class="line">env<span class="section">[TMP]</span> = /tmp</span><br><span class="line"></span><br><span class="line"><span class="comment">; should be accessible by your web server</span></span><br><span class="line"><span class="attr">listen.owner</span> = http</span><br><span class="line"><span class="attr">listen.group</span> = http</span><br><span class="line"></span><br><span class="line"><span class="attr">pm</span> = dynamic</span><br><span class="line"><span class="attr">pm.max_children</span> = <span class="number">15</span></span><br><span class="line"><span class="attr">pm.start_servers</span> = <span class="number">2</span></span><br><span class="line"><span class="attr">pm.min_spare_servers</span> = <span class="number">1</span></span><br><span class="line"><span class="attr">pm.max_spare_servers</span> = <span class="number">3</span></span><br></pre></td></tr></table></figure>
<p>运行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl edit php-fpm.service</span><br></pre></td></tr></table></figure>
<p>编辑 php-fpm 服务：</p>
<figure class="highlight ini"><figcaption><span>/etc/systemd/system/php-fpm.service.d/override.conf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[Service]</span></span><br><span class="line"><span class="comment"># Your data directory</span></span><br><span class="line"><span class="attr">ReadWritePaths</span>=/var/lib/nextcloud/data</span><br><span class="line"></span><br><span class="line"><span class="comment"># Optional: add if you&#x27;ve set the default apps directory to be writable in config.php</span></span><br><span class="line"><span class="attr">ReadWritePaths</span>=/usr/share/webapps/nextcloud/apps</span><br><span class="line"></span><br><span class="line"><span class="comment"># Optional: unnecessary if you&#x27;ve set &#x27;config_is_read_only&#x27; =&gt; true in your config.php</span></span><br><span class="line"><span class="attr">ReadWritePaths</span>=/usr/share/webapps/nextcloud/config</span><br><span class="line"></span><br><span class="line"><span class="attr">ReadWritePaths</span>=/etc/webapps/nextcloud/config</span><br><span class="line"></span><br><span class="line"><span class="comment"># Optional: add if you want to use Nextcloud&#x27;s internal update process</span></span><br><span class="line"><span class="comment"># ReadWritePaths=/usr/share/webapps/nextcloud</span></span><br></pre></td></tr></table></figure>
<p>启用 php-fpm 服务：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">systemctl <span class="built_in">enable</span> php-fpm.service</span><br><span class="line">systemctl start php-fpm.service</span><br></pre></td></tr></table></figure>
<h2 id="5-配置域名"><a class="header-anchor" href="#5-配置域名"></a>5. 配置域名</h2>
<p>我的域名是托管在阿里云，在 dns 解析中添加三级域名 nextcloud 解析，并申请 ssl 证书。</p>
<p>证书下载之后，上传到 <code>/etc/nginx/ssl/</code>。</p>
<h2 id="6-配置-nginx"><a class="header-anchor" href="#6-配置-nginx"></a>6. 配置 nginx</h2>
<p>在 nginx 添加配置，基本是按照<span class="exturl" data-url="aHR0cHM6Ly9kb2NzLm5leHRjbG91ZC5jb20vc2VydmVyL2xhdGVzdC9hZG1pbl9tYW51YWwvaW5zdGFsbGF0aW9uL25naW54Lmh0bWw=">官方参考文件<i class="fa fa-external-link-alt"></i></span> 来的，只修改了 <code>php-handler</code>、<code>server_name</code>、<code>ssl_certificate</code> 和 <code>root</code>：</p>
<figure class="highlight nginx"><figcaption><span>/etc/nginx/site-available/nextcloud.conf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">upstream</span> php-handler &#123;</span><br><span class="line">    <span class="attribute">server</span> unix:/run/nextcloud/nextcloud.sock;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="section">server</span> &#123;</span><br><span class="line">    <span class="attribute">listen</span> <span class="number">80</span>;</span><br><span class="line">    <span class="attribute">listen</span> [::]:<span class="number">80</span>;</span><br><span class="line">    <span class="attribute">server_name</span> &lt;nextcloud.example.com&gt;;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Enforce HTTPS</span></span><br><span class="line">    <span class="attribute">return</span> <span class="number">301</span> https://<span class="variable">$server_name</span><span class="variable">$request_uri</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="section">server</span> &#123;</span><br><span class="line">    <span class="attribute">listen</span> <span class="number">443</span>      ssl http2;</span><br><span class="line">    <span class="attribute">listen</span> [::]:<span class="number">443</span> ssl http2;</span><br><span class="line">    <span class="attribute">server_name</span> &lt;nextcloud.example.com&gt;;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Use Mozilla&#x27;s guidelines for SSL/TLS settings</span></span><br><span class="line">    <span class="comment"># https://mozilla.github.io/server-side-tls/ssl-config-generator/</span></span><br><span class="line">    <span class="attribute">ssl_certificate</span>     ssl/&lt;nextcloud.example.com&gt;.pem;</span><br><span class="line">    <span class="attribute">ssl_certificate_key</span> ssl/&lt;nextcloud.example.com&gt;.key;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># HSTS settings</span></span><br><span class="line">    <span class="comment"># WARNING: Only add the preload option once you read about</span></span><br><span class="line">    <span class="comment"># the consequences in https://hstspreload.org/. This option</span></span><br><span class="line">    <span class="comment"># will add the domain to a hardcoded list that is shipped</span></span><br><span class="line">    <span class="comment"># in all major browsers and getting removed from this list</span></span><br><span class="line">    <span class="comment"># could take several months.</span></span><br><span class="line">    <span class="comment">#add_header Strict-Transport-Security &quot;max-age=15768000; includeSubDomains; preload;&quot; always;</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># set max upload size</span></span><br><span class="line">    <span class="attribute">client_max_body_size</span> <span class="number">1024M</span>;</span><br><span class="line">    <span class="attribute">fastcgi_buffers</span> <span class="number">64</span> <span class="number">4K</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Enable gzip but do not remove ETag headers</span></span><br><span class="line">    <span class="attribute">gzip</span> <span class="literal">on</span>;</span><br><span class="line">    <span class="attribute">gzip_vary</span> <span class="literal">on</span>;</span><br><span class="line">    <span class="attribute">gzip_comp_level</span> <span class="number">4</span>;</span><br><span class="line">    <span class="attribute">gzip_min_length</span> <span class="number">256</span>;</span><br><span class="line">    <span class="attribute">gzip_proxied</span> expired <span class="literal">no</span>-cache <span class="literal">no</span>-store private no_last_modified no_etag auth;</span><br><span class="line">    <span class="attribute">gzip_types</span> application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Pagespeed is not supported by Nextcloud, so if your server is built</span></span><br><span class="line">    <span class="comment"># with the `ngx_pagespeed` module, uncomment this line to disable it.</span></span><br><span class="line">    <span class="comment">#pagespeed off;</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># HTTP response headers borrowed from Nextcloud `.htaccess`</span></span><br><span class="line">    <span class="attribute">add_header</span> Referrer-Policy                      <span class="string">&quot;no-referrer&quot;</span>   always;</span><br><span class="line">    <span class="attribute">add_header</span> X-Content-Type-Options               <span class="string">&quot;nosniff&quot;</span>       always;</span><br><span class="line">    <span class="attribute">add_header</span> X-Download-Options                   <span class="string">&quot;noopen&quot;</span>        always;</span><br><span class="line">    <span class="attribute">add_header</span> X-Frame-Options                      <span class="string">&quot;SAMEORIGIN&quot;</span>    always;</span><br><span class="line">    <span class="attribute">add_header</span> X-Permitted-Cross-Domain-Policies    <span class="string">&quot;none&quot;</span>          always;</span><br><span class="line">    <span class="attribute">add_header</span> X-Robots-Tag                         <span class="string">&quot;none&quot;</span>          always;</span><br><span class="line">    <span class="attribute">add_header</span> X-XSS-Protection                     <span class="string">&quot;1; mode=block&quot;</span> always;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Remove X-Powered-By, which is an information leak</span></span><br><span class="line">    <span class="attribute">fastcgi_hide_header</span> X-Powered-By;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Path to the root of your installation</span></span><br><span class="line">    <span class="attribute">root</span> /usr/share/webapps/nextcloud;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Specify how to handle directories -- specifying `/index.php$request_uri`</span></span><br><span class="line">    <span class="comment"># here as the fallback means that Nginx always exhibits the desired behaviour</span></span><br><span class="line">    <span class="comment"># when a client requests a path that corresponds to a directory that exists</span></span><br><span class="line">    <span class="comment"># on the server. In particular, if that directory contains an index.php file,</span></span><br><span class="line">    <span class="comment"># that file is correctly served; if it doesn&#x27;t, then the request is passed to</span></span><br><span class="line">    <span class="comment"># the front-end controller. This consistent behaviour means that we don&#x27;t need</span></span><br><span class="line">    <span class="comment"># to specify custom rules for certain paths (e.g. images and other assets,</span></span><br><span class="line">    <span class="comment"># `/updater`, `/ocm-provider`, `/ocs-provider`), and thus</span></span><br><span class="line">    <span class="comment"># `try_files $uri $uri/ /index.php$request_uri`</span></span><br><span class="line">    <span class="comment"># always provides the desired behaviour.</span></span><br><span class="line">    <span class="attribute">index</span> index.php index.html /index.php<span class="variable">$request_uri</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Rule borrowed from `.htaccess` to handle Microsoft DAV clients</span></span><br><span class="line">    <span class="section">location</span> = / &#123;</span><br><span class="line">        <span class="attribute">if</span> ( <span class="variable">$http_user_agent</span> <span class="regexp">~ ^DavClnt</span> ) &#123;</span><br><span class="line">            <span class="attribute">return</span> <span class="number">302</span> /remote.php/webdav/<span class="variable">$is_args</span><span class="variable">$args</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="section">location</span> = /robots.txt &#123;</span><br><span class="line">        <span class="attribute">allow</span> all;</span><br><span class="line">        <span class="attribute">log_not_found</span> <span class="literal">off</span>;</span><br><span class="line">        <span class="attribute">access_log</span> <span class="literal">off</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Make a regex exception for `/.well-known` so that clients can still</span></span><br><span class="line">    <span class="comment"># access it despite the existence of the regex rule</span></span><br><span class="line">    <span class="comment"># `location ~ /(\.|autotest|...)` which would otherwise handle requests</span></span><br><span class="line">    <span class="comment"># for `/.well-known`.</span></span><br><span class="line">    <span class="section">location</span><span class="regexp"> ^~</span> /.well-known &#123;</span><br><span class="line">        <span class="comment"># The rules in this block are an adaptation of the rules</span></span><br><span class="line">        <span class="comment"># in `.htaccess` that concern `/.well-known`.</span></span><br><span class="line"></span><br><span class="line">        <span class="section">location</span> = /.well-known/carddav &#123; <span class="attribute">return</span> <span class="number">301</span> /remote.php/dav/; &#125;</span><br><span class="line">        <span class="section">location</span> = /.well-known/caldav  &#123; <span class="attribute">return</span> <span class="number">301</span> /remote.php/dav/; &#125;</span><br><span class="line"></span><br><span class="line">        <span class="section">location</span> /.well-known/acme-challenge    &#123; <span class="attribute">try_files</span> <span class="variable">$uri</span> <span class="variable">$uri</span>/ =<span class="number">404</span>; &#125;</span><br><span class="line">        <span class="section">location</span> /.well-known/pki-validation    &#123; <span class="attribute">try_files</span> <span class="variable">$uri</span> <span class="variable">$uri</span>/ =<span class="number">404</span>; &#125;</span><br><span class="line"></span><br><span class="line">        <span class="comment"># Let Nextcloud&#x27;s API for `/.well-known` URIs handle all other</span></span><br><span class="line">        <span class="comment"># requests by passing them to the front-end controller.</span></span><br><span class="line">        <span class="attribute">return</span> <span class="number">301</span> /index.php<span class="variable">$request_uri</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Rules borrowed from `.htaccess` to hide certain paths from clients</span></span><br><span class="line">    <span class="section">location</span> <span class="regexp">~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)</span>  &#123; <span class="attribute">return</span> <span class="number">404</span>; &#125;</span><br><span class="line">    <span class="section">location</span> <span class="regexp">~ ^/(?:\.|autotest|occ|issue|indie|db_|console)</span>                &#123; <span class="attribute">return</span> <span class="number">404</span>; &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Ensure this block, which passes PHP files to the PHP process, is above the blocks</span></span><br><span class="line">    <span class="comment"># which handle static assets (as seen below). If this block is not declared first,</span></span><br><span class="line">    <span class="comment"># then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`</span></span><br><span class="line">    <span class="comment"># to the URI, resulting in a HTTP 500 error response.</span></span><br><span class="line">    <span class="section">location</span> <span class="regexp">~ \.php(?:$|/)</span> &#123;</span><br><span class="line">        <span class="attribute">fastcgi_split_path_info</span><span class="regexp"> ^(.+?\.php)(/.*)$</span>;</span><br><span class="line">        <span class="attribute">set</span> <span class="variable">$path_info</span> <span class="variable">$fastcgi_path_info</span>;</span><br><span class="line"></span><br><span class="line">        <span class="attribute">try_files</span> <span class="variable">$fastcgi_script_name</span> =<span class="number">404</span>;</span><br><span class="line"></span><br><span class="line">        <span class="attribute">include</span> fastcgi_params;</span><br><span class="line">        <span class="attribute">fastcgi_param</span> SCRIPT_FILENAME <span class="variable">$document_root</span><span class="variable">$fastcgi_script_name</span>;</span><br><span class="line">        <span class="attribute">fastcgi_param</span> PATH_INFO <span class="variable">$path_info</span>;</span><br><span class="line">        <span class="attribute">fastcgi_param</span> HTTPS <span class="literal">on</span>;</span><br><span class="line"></span><br><span class="line">        <span class="attribute">fastcgi_param</span> modHeadersAvailable <span class="literal">true</span>;         <span class="comment"># Avoid sending the security headers twice</span></span><br><span class="line">        <span class="attribute">fastcgi_param</span> front_controller_active <span class="literal">true</span>;     <span class="comment"># Enable pretty urls</span></span><br><span class="line">        <span class="attribute">fastcgi_pass</span> php-handler;</span><br><span class="line"></span><br><span class="line">        <span class="attribute">fastcgi_intercept_errors</span> <span class="literal">on</span>;</span><br><span class="line">        <span class="attribute">fastcgi_request_buffering</span> <span class="literal">off</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="section">location</span> <span class="regexp">~ \.(?:css|js|svg|gif)$</span> &#123;</span><br><span class="line">        <span class="attribute">try_files</span> <span class="variable">$uri</span> /index.php<span class="variable">$request_uri</span>;</span><br><span class="line">        <span class="attribute">expires</span> <span class="number">6M</span>;         <span class="comment"># Cache-Control policy borrowed from `.htaccess`</span></span><br><span class="line">        <span class="attribute">access_log</span> <span class="literal">off</span>;     <span class="comment"># Optional: Don&#x27;t log access to assets</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="section">location</span> <span class="regexp">~ \.woff2?$</span> &#123;</span><br><span class="line">        <span class="attribute">try_files</span> <span class="variable">$uri</span> /index.php<span class="variable">$request_uri</span>;</span><br><span class="line">        <span class="attribute">expires</span> <span class="number">7d</span>;         <span class="comment"># Cache-Control policy borrowed from `.htaccess`</span></span><br><span class="line">        <span class="attribute">access_log</span> <span class="literal">off</span>;     <span class="comment"># Optional: Don&#x27;t log access to assets</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment"># Rule borrowed from `.htaccess`</span></span><br><span class="line">    <span class="section">location</span> /remote &#123;</span><br><span class="line">        <span class="attribute">return</span> <span class="number">301</span> /remote.php<span class="variable">$request_uri</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="section">location</span> / &#123;</span><br><span class="line">        <span class="attribute">try_files</span> <span class="variable">$uri</span> <span class="variable">$uri</span>/ /index.php<span class="variable">$request_uri</span>;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>然后启用该配置：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">ln</span> -s /etc/nginx/site-available/nextcloud.conf /etc/nginx/site-enabled/nextcloud.conf</span><br></pre></td></tr></table></figure>
<p>原来的 nginx 中已有配置：</p>
<figure class="highlight nginx"><figcaption><span>/etc/nginx/nginx.conf</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">http</span> &#123;</span><br><span class="line">    <span class="comment"># ...</span></span><br><span class="line">    <span class="attribute">include</span> /etc/nginx/sites-enabled/*;</span><br><span class="line">    <span class="comment"># ...</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>之后重启 nginx 服务：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl restart nginx</span><br></pre></td></tr></table></figure>
<h2 id="7-配置-nextcloud"><a class="header-anchor" href="#7-配置-nextcloud"></a>7. 配置 nextcloud</h2>
<p>在 nextcloud 的配置文件中添加：</p>
<figure class="highlight php"><figcaption><span>/etc/webapps/nextcloud/config.php</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&#x27;trusted_domains&#x27;</span> =&gt; [</span><br><span class="line">    <span class="string">&#x27;&lt;nextcloud.example.com&gt;&#x27;</span></span><br><span class="line">  ]</span><br></pre></td></tr></table></figure>
<p>然后安装 nextcloud：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">occ maintenance:install --database mysql --database-name nextcloud --database-host localhost --database-user nextcloud --database-pass=<span class="string">&#x27;&lt;password&gt;&#x27;</span> --data-dir /var/lib/nextcloud/data</span><br></pre></td></tr></table></figure>
<p>然后就可以登录了！</p>
<h2 id="8-配置-pacman-hook"><a class="header-anchor" href="#8-配置-pacman-hook"></a>8. 配置 pacman hook</h2>
<p>在 nextcloud 软件包更新后，自动更新 nextcloud 数据库：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> -vp /etc/pacman.d/hooks</span><br><span class="line"><span class="built_in">ln</span> -sv /usr/share/doc/nextcloud/nextcloud.hook /etc/pacman.d/hooks/</span><br></pre></td></tr></table></figure>
<hr />
<p>参考：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly93aWtpLmFyY2hsaW51eC5vcmcvaW5kZXgucGhwL05leHRjbG91ZA==">ArchWiki: Nextcloud<i class="fa fa-external-link-alt"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly93aWtpLmFyY2hsaW51eC5vcmcvaW5kZXgucGhwL01hcmlhREI=">ArckWiki: MariaDB<i class="fa fa-external-link-alt"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9kb2NzLm5leHRjbG91ZC5jb20vc2VydmVyL2xhdGVzdC9hZG1pbl9tYW51YWwvY29udGVudHMuaHRtbA==">Documentation: Nextcloud<i class="fa fa-external-link-alt"></i></span></li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>西风冷香
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/" title="在 ArchLinux 上安装 Nextcloud">https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/</a>
  </li>
  <li class="post-copyright-license">
      <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC9kZWVkLnpo"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

          <div class="followme">
  <span>欢迎关注我的其它发布渠道</span>

  <div class="social-list">

      <div class="social-item">
          <span class="social-link">
            <span class="icon">
              <i class="fab fa-weixin"></i>
            </span>

            <span class="label">WeChat</span>
          </span>

          <img class="social-item-img" src="/images/wechat_channel.jpg">
      </div>

      <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
      </div>
  </div>
</div>

          <div class="post-tags">
              <a href="/tags/ArchLinux/" rel="tag"><i class="fa fa-tag"></i> ArchLinux</a>
              <a href="/tags/Nextcloud/" rel="tag"><i class="fa fa-tag"></i> Nextcloud</a>
              <a href="/tags/Nginx/" rel="tag"><i class="fa fa-tag"></i> Nginx</a>
              <a href="/tags/Vultr/" rel="tag"><i class="fa fa-tag"></i> Vultr</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/posts/2021-03-31-Notability-vs-GoodNotes-2021/" rel="prev" title="Notability 与 GoodNotes 在网课教学中的对比（2021版）">
                  <i class="fa fa-angle-left"></i> Notability 与 GoodNotes 在网课教学中的对比（2021版）
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/posts/2021-04-21-Use-ctex-with-founder-font/" rel="next" title="在 CTeX 中使用方正字体">
                  在 CTeX 中使用方正字体 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






      <div class="tabs tabs-comment">
        <ul class="nav-tabs">
            <li class="tab"><a href="#comment-disqusjs">Disqus</a></li>
            <li class="tab"><a href="#comment-giscus">GitHub</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane disqusjs" id="comment-disqusjs">
              
  <div class="comments disqusjs-container">
    <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
  </div>
  
            </div>
            <div class="tab-pane giscus" id="comment-giscus">
              
  
  <div class="comments giscus-container">
  </div>
  
  
            </div>
        </div>
      </div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="beian"><span class="exturl" data-url="aHR0cHM6Ly9iZWlhbi5taWl0Lmdvdi5jbg=="><nopangu>冀ICP备2024063721号-1</nopangu> </span>
      <img src="/images/gongan.png" alt=""><span class="exturl" data-url="aHR0cHM6Ly9iZWlhbi5tcHMuZ292LmNuLyMvcXVlcnkvd2ViU2VhcmNoP2NvZGU9MTMwOTAyMDIwMDA3MTY="><nopangu>冀公网安备13090202000716号</nopangu> </span>
  </div>
  <div class="copyright">
    &copy; 2014 – 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">西风冷香</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
    <span title="站点总字数">223k</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">由 <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl" data-url="aHR0cHM6Ly90aGVtZS1uZXh0LmpzLm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

<div class="blog-links">
    <span class="post-meta-item moe">
      <span>
        <img src="/images/icp-moe.png" style="width:auto;height:16px;" alt="">
      </span>
      <span><span class="exturl" data-url="aHR0cHM6Ly9pY3AuZ292Lm1vZS8/a2V5d29yZD0yMDI0ODE5MQ=="><nopangu>萌ICP备20248191号</nopangu></span>
      </span>
    </span>
    <span class="post-meta-item travel-moe">
      <span><span class="exturl" data-url="aHR0cHM6Ly90cmF2ZWwubW9lL2dvLmh0bWw/dHJhdmVsPW9u"><img src="/images/travel-moe.png" style="width:auto;height:18px" title="异次元之旅-跃迁-我们一起去萌站成员的星球旅行吧！"> 异次元之旅🚀</span>
      </span>
    </span>
    <span class="post-meta-item foreverblog"><span class="exturl" data-url="aHR0cHM6Ly93d3cuZm9yZXZlcmJsb2cuY24vYmxvZy8yMDkyLmh0bWw="><img src="/images/foreverblog.png" style="width:auto;height:16px;" alt="Forever Blog"></span>
    </span>
    <span class="post-meta-item wormhole"><span class="exturl" data-url="aHR0cHM6Ly93d3cuZm9yZXZlcmJsb2cuY24vZ28uaHRtbA=="><img src="/images/wormhole.gif" style="width:auto;height:24px;" alt="" title="穿梭虫洞-随机访问十年之约友链博客"></span>
    </span>
    <span class="post-meta-item travelling"><span class="exturl" data-url="aHR0cHM6Ly93d3cudHJhdmVsbGluZ3MuY24vZ28uaHRtbA=="><img src="/images/travelling.png" alt="开往-友链接力" height="18"></span>
    </span>
  
</div>

<script>
function checkWebp(callback) {
  var img = new Image();
  img.onload = function () { callback((img.width > 0) && (img.height > 0)); };
  img.onerror = function () { callback(false); };
  img.src = '';
}
function showImage(useWebp) {
  var imgs = [].slice.call(document.querySelectorAll('img'));
  imgs.forEach(function (e) {
    if ((useWebp) && !e.classList.contains('nowebp')) {
      var src = e.getAttribute('data-src')
      if (src !== null) {
        src = src.replace(/\.jpg$/, '.webp').replace(/\.jpeg$/, '.webp').replace(/\.png$/, '.webp').replace(/\.gif$/, '.webp');
        e.setAttribute('data-src', src);
      }
      src = e.getAttribute('src')
      if (src !== null) {
        src = src.replace(/\.jpg$/, '.webp').replace(/\.jpeg$/, '.webp').replace(/\.png$/, '.webp').replace(/\.gif$/, '.webp');
        e.setAttribute('src', src);
      }
    }
  });
}
</script>
<script data-pjax async>
checkWebp(showImage);
</script>


    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdn.staticfile.net/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdn.staticfile.net/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdn.staticfile.net/medium-zoom/1.1.0/medium-zoom.min.js" integrity="sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc=" crossorigin="anonymous"></script>
  <script src="https://cdn.staticfile.net/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/sidebar.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdn.staticfile.net/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>

  <script class="next-config" data-name="pdf" type="application/json">{"object_url":{"url":"https://cdn.staticfile.net/pdfobject/2.3.0/pdfobject.min.js","integrity":"sha256-JJZNsid68vnh3/zyj0lY9BN5ynxVX/12XgOa1TlaYN0="},"url":"/lib/pdf/web/viewer.html"}</script>
  <script src="/js/third-party/tags/pdf.js"></script>






  
  <script data-pjax async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  <script src="https://cdn.staticfile.net/firebase/10.14.1/firebase-app-compat.js" integrity="sha256-KsPwUaqMNX8FDBi2qNV4Z/We2FthlJrPIRQhOVgfXMQ=" crossorigin="anonymous"></script>
  <script src="https://cdn.staticfile.net/firebase/10.14.1/firebase-firestore-compat.js" integrity="sha256-oPdfryMK6T4WGGJbidMkl/7TIOrnkCJ8BqrOT8En2a4=" crossorigin="anonymous"></script>
  <script class="next-config" data-name="firestore" type="application/json">{"enable":true,"collection":"articles","apiKey":"AIzaSyD0AfWHrmFoKgV1x4srPQDN7rGpGclK7J4","projectId":"visitors-of-blog"}</script>
  <script src="/js/third-party/statistics/firestore.js"></script>



  

  <script class="next-config" data-name="enableMath" type="application/json">false</script><link rel="stylesheet" href="https://cdn.staticfile.net/KaTeX/0.16.9/katex.min.css" integrity="sha256-UF1fgpAiu3tPJN/uCqEUHNe7pnr+QR0SQDNfgglgtcM=" crossorigin="anonymous">
  <script class="next-config" data-name="katex" type="application/json">{"copy_tex_js":{"url":"https://cdn.staticfile.net/KaTeX/0.16.9/contrib/copy-tex.min.js","integrity":"sha256-Us54+rSGDSTvIhKKUs4kygE2ipA0RXpWWh0/zLqw3bs="}}</script>
  <script src="/js/third-party/math/katex.js"></script>


  <script src="https://cdn.staticfile.net/quicklink/2.3.0/quicklink.umd.js" integrity="sha256-yvJQOINiH9fWemHn0vCA5lsHWJaHs6/ZmO+1Ft04SvM=" crossorigin="anonymous"></script>
  <script class="next-config" data-name="quicklink" type="application/json">{"enable":true,"home":false,"archive":false,"delay":true,"timeout":3000,"priority":true,"url":"https://wangjiezhe.gitee.io/posts/2021-04-09-Install-Nextcloud-on-vultr/"}</script>
  <script src="/js/third-party/quicklink.js"></script>
<script class="next-config" data-name="giscus" type="application/json">{"enable":true,"repo":"wangjiezhe/wangjiezhe.github.io","repo_id":"MDEwOlJlcG9zaXRvcnkxNTc4OTE0Ng==","category":"Announcements","category_id":"DIC_kwDOAPDsWs4Cdwtf","mapping":"og:title","strict":1,"reactions_enabled":1,"emit_metadata":1,"theme":"preferred_color_scheme","lang":"zh-CN","crossorigin":"anonymous","input_position":"top","loading":"lazy"}</script>

<script>
document.addEventListener('page:loaded', () => {
  if (!CONFIG.page.comments) return;

  NexT.utils.loadComments('.giscus-container')
    .then(() => NexT.utils.getScript('https://giscus.app/client.js', {
      attributes: {
        async                   : true,
        crossOrigin             : 'anonymous',
        'data-repo'             : CONFIG.giscus.repo,
        'data-repo-id'          : CONFIG.giscus.repo_id,
        'data-category'         : CONFIG.giscus.category,
        'data-category-id'      : CONFIG.giscus.category_id,
        'data-mapping'          : CONFIG.giscus.mapping,
        'data-strict'           : CONFIG.giscus.strict,
        'data-reactions-enabled': CONFIG.giscus.reactions_enabled,
        'data-emit-metadata'    : CONFIG.giscus.emit_metadata,
        'data-theme'            : CONFIG.giscus.theme,
        'data-lang'             : CONFIG.giscus.lang,
        'data-input-position'   : CONFIG.giscus.input_position,
        'data-loading'          : CONFIG.giscus.loading
      },
      parentNode: document.querySelector('.giscus-container')
    }));
});
</script>
<link rel="stylesheet" href="https://cdn.staticfile.net/disqusjs/3.0.2/styles/disqusjs.css" integrity="sha256-71XarXwNr1Td27HmZI9zjY+rMzRdush6/glo6VFXp7o=" crossorigin="anonymous">

<script class="next-config" data-name="disqusjs" type="application/json">{"enable":true,"api":"https://disqusjs.wangjiezhe.com/","apikey":"ENTX2OPfWXIYJpFIZ1WVpYt4F0Ri0PLUELMOCbM8HHIX9C9BqEbkBZWmK7lqKj7F","shortname":"wangjiezhe","js":{"url":"https://cdn.staticfile.net/disqusjs/3.0.2/disqusjs.es2015.umd.min.js","integrity":"sha256-okP99ZQKVpIy7+NogAMpGlIQzJa9XKXhIJcFgdju5bU="}}</script>
<script src="/js/third-party/comments/disqusjs.js"></script>



  <script async src="/js/cursor/fireworks.min.js" integrity="sha256-NVjeK0/Qni9W+mCWpzpw6IZTieyhLZJ5Kj4hdFjqSQc=" crossorigin="anonymous"></script>



<script src="/live2dw/lib/L2Dwidget.min.js?02887b17076210cf9f6ed81f0eed64e3"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/mikoto.model.json"},"display":{"position":"left"},"mobile":{"show":false},"log":false});</script></body>
</html>
